﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App_SiteMasterPage/Site.Master"
    AutoEventWireup="true" CodeBehind="AirportsManagementPro.aspx.cs" Inherits="eProject.Web.UI.AirportsManagementPro" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="script" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="LeftContent" runat="server">
    <div id="widget-categories" class="widget widget-categories">
        <div class="widget-inner">
            <div class="widget-title">
                <h5>
                    Airports</h5>
            </div>
            <div class="widget-content">
                <ul>
                    <li><a class="add" href="AirportManagementAddNew.aspx">Add New</a></li>
                    <li><a href="AirportsManagementPro.aspx">List Airports</a></li>
                </ul>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="RightContent" runat="server">
    <div class="widget">
        <div class="widget-inner">
            <div class="widget-title">
                <h5>
                    Airports
                </h5>
            </div>
            <div class="widget-content">
                <div align="center">
                    Search:
                    <asp:TextBox ID="txtSearchText" Width="400px" runat="server"></asp:TextBox>
                    <asp:CheckBox ID="cbDelete" runat="server" Checked="false" Text="Is Deleted" />
                    <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
                </div>
                <asp:GridView ID="grvAirport" runat="server" CssClass="tbStyles" DataKeyNames="Id"
                    AutoGenerateColumns="False" EmptyDataText="You dont have any airports!" OnPageIndexChanging="grvAirports_PageIndexChanging"
                    OnRowEditing="grvAirports_RowEditing" OnRowDeleting="grvAirports_RowDeleting"
                    OnRowUpdating="grvAirports_RowUpdating" AllowPaging="True" PageSize="20">
                    <Columns>
                        <asp:TemplateField HeaderText="Edit">
                            <ItemTemplate>
                                <asp:ImageButton ID="btnEdit" runat="server" CausesValidation="False" CommandName="Edit"
                                    ImageUrl="~/Images/Icons/edit.png" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField Visible="false" HeaderText="ID">
                            <ItemTemplate>
                                <asp:Label ID="lblID" runat="server" Text='<%# Eval("Id") %>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Airport Code">
                            <ItemTemplate>
                                <asp:Label ID="lblAirportID" runat="server" Text='<%# Eval("AirPortId") %>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="AirPort Name">
                            <ItemTemplate>
                                <asp:Label ID="lblPlaneName" runat="server" Text='<%# Eval("Name") %>'>
                                </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="City">
                            <ItemTemplate>
                                <asp:DropDownList ID="ddlCityId" runat="server" Enabled="false" DataSource='<%# BindCities() %>'
                                    DataTextField="Name" DataValueField="Id" SelectedValue='<%# Eval("CityID") %>'>
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Created Date">
                            <ItemTemplate>
                                <asp:Label ID="lblCreatedDate" runat="Server" Text='<%# Eval("CreatedDate", "{0:dd/MM/yyyy}") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Last Update">
                            <ItemTemplate>
                                <asp:Label ID="lblLastUpdate" runat="Server" Text='<%# Eval("LastUpdate", "{0:dd/MM/yyyy}") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Delete">
                            <ItemTemplate>
                                <asp:ImageButton ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                    ImageUrl="~/Images/Icons/delete.png" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Active">
                            <ItemTemplate>
                                <asp:ImageButton ID="btnUpdate" runat="server" CausesValidation="False" CommandName="Update"
                                    ImageUrl="~/Images/Icons/back.png" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    <PagerSettings Mode="NextPreviousFirstLast" FirstPageImageUrl="~/Images/Icons/FirstPage.png"
                        FirstPageText="First Page" LastPageImageUrl="~/Images/Icons/LastPage.png" LastPageText="Last Page"
                        NextPageImageUrl="~/Images/Icons/NextPage.png" NextPageText="Next Page" PreviousPageImageUrl="~/Images/Icons/PreviousPage.png"
                        PreviousPageText="Previous Page" Position="Bottom" />
                </asp:GridView>
            </div>
        </div>
    </div>
</asp:Content>
